let p = new Promise((resolve, reject) => {
    let xhr = new XMLHttpRequest();
    xhr.open("get", "url？", true)//resful 规范 api
    xhr.send("传参")
    xhr.onreadystatechange = function () {
        if (xhr.readyState == 4) {
            if (xhr.status == 200) {
                //不在写业务，
                resolve(xhr.responseText);
            } else {
                reject(xhr.status);
            }
        }
    }
})
p.then((data) => {
    //业务逻辑，处理data
})
.catch((err)=>{
    console.log(err);
})


//1,proimise解决的问题：回调地狱； =>链式
//2,new .then.catch  
//3.状态：3种，
//4. Promise.all  Promise.race()
//5. async await promise
